#ifndef MENUBUTTON_H
#define MENUBUTTON_H
#include "imageitem.h"

class MenuButton : public ImageItem
{
    Q_OBJECT
public:
    MenuButton(const QString &normalPicName,
               const QString &activePicName,
               const QString &highlightPicName,
               QGraphicsScene *scene = 0,
               QGraphicsItem *parent = 0,
               const QSize &size = QSize());

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    enum State
    {
        NORMAL,
        ACTIVE,
        HIGHLIGHT
    };

    void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);

signals:
    void clicked(MenuButton *button);
protected:
    QString activeName;
    QString highlightName;
    QPixmap activePixmap;
    QPixmap highlightPixmap;

    State state;
};

#endif // MENUBUTTON_H
